package gui;

import core.aln.Reader;
import core.aln.Worker;
import java.io.File;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;

/*Author: John Archer, Contact: john.archer.jpa@gmail.com*/
public class Run {
    public static JFrame segL0;
    public static void main (String[] args){
        if(moved()){
            JOptionPane.showMessageDialog(null, ".jar has been moved. Please return it or redownload the .zip file.", "alert", JOptionPane.ERROR_MESSAGE);
            System.exit(0);
        }
        try{
            //System.setProperty("apple.laf.useScreenMenuBar", "true");
            UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
                segL0 = new Segl0();
            read();
        }
        catch(Exception e){System.exit(0);}
    }
    private static void read(){
        if(Reader.read==false){(new Worker(new Reader())).execute();}
    }
    public static JFrame getRpgs_frame(){return segL0;}
    private static boolean moved(){
        File appsDir = new File("."+File.separator+"lib");
        if(!appsDir.exists()){return true;}
        return false;
    }
}